package cn.hyatt.auth.event;

import cn.hyatt.auth.dto.auth.AuthInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 认证事件
 *
 * @author hyatt
 */
public interface AuthEvent {




    /**
     * 登录成功
     */
    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    class LoginSuccess {
        @Schema(description = "登录用户ID")
        private Long loginUserId;

        @Schema(description = "登录用户名")
        private String loginUsername;

        @Schema(description = "认证信息")
        private AuthInfo authInfo;
    }

    /**
     * 刷新Token
     */
    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    class FlushedToken {
        @Schema(description = "登录用户ID")
        private Long loginUserId;

        @Schema(description = "认证信息")
        private AuthInfo authInfo;
    }

    /**
     * 注销登录
     */
    @Getter
    @Setter
    @NoArgsConstructor
    @AllArgsConstructor
    class Logout {
        @Schema(description = "登录用户ID")
        private Long loginUserId;
    }
}
